//
//  RequestManager.h
//  AFNetworking
//
//  Created by yons on 24.9.20.
//

#import <Foundation/Foundation.h>
#import "AFHTTPSessionManager+ConfigSessionManager.h"

NS_ASSUME_NONNULL_BEGIN

@interface SMRequestManager : NSObject

/// 类方法封装数据请求类(带进度条)
/// @param url url地址
/// @param method 请求方式
/// @param parameters 请求参数
/// @param downloadProgress 进度
/// @param success 成功回调
/// @param failure 失败回调
+ (NSURLSessionDataTask *)requestWithURL:(NSString *)url
                              httpMethod:(HttpMethod)method
                              parameters:(nullable id)parameters
                                progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
                                 success:(nullable void (^)(id _Nullable responseObject))success
                                 failure:(nullable void (^)(NSError *error))failure;


/// 类方法封装数据请求类(不带进度条)
/// @param url url地址
/// @param method 请求方式
/// @param parameters 请求参数
/// @param success 成功回调
/// @param failure 失败回调
+ (NSURLSessionDataTask *)requestWithURL:(NSString *)url
                              httpMethod:(HttpMethod)method
                              parameters:(nullable id)parameters
                                 success:(nullable void (^)(id _Nullable responseObject))success
                                 failure:(nullable void (^)(NSError *error))failure;


/// 类方法封装图片上传请求类(带进度条)
/// @param url url地址
/// @param parameters 参数
/// @param imageArray 图片数组
/// @param name 指定名称
/// @param success 成功回调
/// @param failure 失败回调
+ (NSURLSessionDataTask *)uploadImageWithURL:(NSString *)url
                                  parameters:(nullable id)parameters
                                  imageArray:(NSArray *)imageArray
                                        name:(NSString *)name
                                    progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
                                     success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
                                     failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;

@end

NS_ASSUME_NONNULL_END
